# Makefile for embedded TXL demo application
# J.R. Cordy, May 2024

# Localization
# CC = gcc -m64 -I /usr/local/lib/txl
CC = gcc -m64 -I ../../lib
# TXLLIB = /usr/local/lib/txl
TXLLIB = ../../lib

# Test multiple embedded runs
all: demo.x
	./demo.x eg*.numbers

# Compile and link with the TXL virtual machine
demo.x : demo.c demo_TXL.c ${TXLLIB}/txlrun.o ${TXLLIB}/txlvm.o
	${CC} -O -w -o demo.x demo.c demo_TXL.c ${TXLLIB}/txlrun.o ${TXLLIB}/txlvm.o -lm

# Convert the TXL program to TXL bytecode in C
# txl2c demo.txl
demo_TXL.c : demo.txl
	./txl2c.sh demo.txl

clean :
	/bin/rm -f demo.x demo_TXL.c *.o
